package com.sjtu.vfact.textual.tablemodel;

import java.util.Set;

import com.sjtu.vfact.textual.model.TermSet;

public class QuickSummarizerTableModel extends VFactTableModel{

	private static final long serialVersionUID = -5728469350011975501L;
		
//	public static final int COL_NO = 0;
	public static final int COL_SUMMARY = 0;
	public static final int COL_DOCIDS = 1;
	public static final int COL_SUPPORT = 2;
	
//	public static final int COL_NO_WIDTH = 10;
	public static final int COL_SUMMARY_WIDTH = 170;
	public static final int COL_DOCIDS_WIDTH = 150;
	public static final int COL_SUPPORT_WIDTH = 30;
	
	public QuickSummarizerTableModel(){
		super();
		setColumnNames(new String[]{"Summary Termset", "DocIDs", "Support"});
	}
	
	public void initializeTableModel(TermSet termset, Set<Integer> docIDs){
		clearTable();
				
		Object[] tuple = new Object[getColumnCount()];
		if(termset != null && docIDs != null){
//			tuple[COL_NO] = 1;
			tuple[COL_SUMMARY] = termset;
			tuple[COL_DOCIDS] = docIDs;
			tuple[COL_SUPPORT] = docIDs.size();
			addRow(tuple);
		}
		
	}
	
}
